[% setvar title Perl 6 Programming Language %]

[% menu nav home %]

[% setvar more_header
    <meta name="description" content="Home page for Perl 6, the newest member of the family of languages known as Perl." />
    <meta name="verify-v1" content="p7bEStVpDsW4ixm9YbF1ck02FRQfdA97ZL9mJnt0iQ0=" />
    <meta name="google-site-verification" content="fDTmO9fcCRRgBqbKirQidKJ6nhTqnolHrKrgwVWJxZA" />
%]

<div class="container-fluid">
  <header id="welcome-header" class="row lead">
    <div class="col-sm-12">
      <div class="panel" style="box-shadow: 1px 1px 3px rgba(0, 0, 0, .3)">
        <div class="panel-primary">
          <div class="panel-heading">
              <h3 class="panel-title"><b>NEW:</b> Perl&nbsp;6 Rakudo Star 2016.11 Production Distribution of Perl 6 Released!</h3>
          </div>
          <div class="panel-body trim" style="background: #fafafa">
            <p style="font-size: 81%">Read the <a href="http://rakudo.org/2016/11/27/announce-rakudo-star-release-2016.11/"
                >release announcement</a> or
              <a href="/downloads">download Rakudo Star and try out Perl&nbsp;6</a>!</p>
          </div>
        </div>
      </div>
    </div>
    <div class="col-sm-9">
      <h1>The <b>Perl&nbsp;6</b> Programming Language</h1>
      <p>Hi, my name is Camelia.  I'm the spokesbug for Perl&nbsp;6,
        the plucky little sister of <a href="http://perl.org">Perl&nbsp;5</a>.
        Like her world-famous big
        sister, Perl&nbsp;6 intends to carry forward the high ideals of
        the Perl community. Perl&nbsp;6 is
        currently being developed by a team of dedicated and enthusiastic
        volunteers. You can help too. The only requirement is that you know
        how to be nice to all kinds of people (and butterflies). Go to
        <a href="http://webchat.freenode.net/?channels=perl6&amp;nick="
          >#perl6 (irc.freenode.net)</a>
        and someone will be glad to help you
          <a href="/getting-started/">get started</a>.
      </p>
    </div>
    <div class="col-sm-3">
      <a href='http://github.com/perl6/mu/raw/master/misc/camelia.txt'><img
        src="camelia-logo.png" alt="camelia perl bug logo"
        class="img-responsive center-block"
      ></a>
    </div>
  </header>

  <main class="row">
    <div class="col-sm-9 row">
      <section class="col-sm-4">
        <div class="well">
          <h3 class="h2 trim-top">Jump in!</h3>
          <p>Rakudo is a compiler for Perl&nbsp;6 code. Install it and you're
            all set to run Perl&nbsp;6 programs!</p>
          <a href="/downloads/"
            class="btn btn-primary btn-lg btn-block"
              style="white-space: normal; font-size: 120%">
            Download Rakudo Perl&nbsp;6
          </a>
        </div>
      </section>
      <div class="col-sm-8">
        <div class="panel panel-info">
          <div class="panel-heading">
            <h3 class="panel-title">
              Many new features greatly advance our tradition of expressive and feature-rich programming
            </h3>
          </div>
          <div class="panel-body trim">
            <ul class="shy-list">
                <li>Object-oriented programming including generics, roles and multiple dispatch</li>
                <li>Functional programming primitives, lazy and eager list evaluation, junctions, autothreading and hyperoperators (vector operators)</li>
                <li>Parallelism, concurrency, and asynchrony including multi-core support</li>
                <li>Definable grammars for pattern matching and generalized string processing</li>
                <li>Optional and gradual typing</li>
            </ul>
          </div>
        </div>
      </div>

      <div class="col-sm-12">
        <ul class="nav nav-tabs" role="tablist">
          <li role="presentation" class="active"
            ><a href="#samp-basic" role="tab"
              data-toggle="tab">Words from File</a>
          </li>
          <li role="presentation"><a href="#samp-fib" role="tab" data-toggle="tab">Lazy Infinite Lists</a></li>
          <li role="presentation"><a href="#samp-ops" role="tab" data-toggle="tab">Custom operators
          </a></li>
          <li role="presentation"><a href="#samp-more" role="tab" data-toggle="tab">More examples</a></li>
        </ul>
        <div class="tab-content">
          <div role="tabpanel" class="tab-pane active" id="samp-basic">
    <div class="highlight"><pre><span class="Statement">for</span> <span class="Special">'</span><span class="Constant">dict.txt</span><span class="Special">'</span><span class="Statement">.</span><span class="Type">IO</span><span class="Statement">.</span>words <span class="Statement">-&gt;</span> <span class="Identifier">$</span><span class="Identifier">word</span> {
      say <span class="Special">&quot;</span><span class="Identifier">$</span><span class="Identifier">word</span><span class="Constant"> probably rhymes with Perl</span><span class="Special">&quot;</span>
          <span class="Statement">if</span> <span class="Identifier">$</span><span class="Identifier">word</span> <span class="Statement">~~</span> <span class="Special">/</span><span class="Special">[</span>ea<span class="Special">?</span><span class="Special">|</span>u<span class="Special">|</span>i<span class="Special">]</span><span class="Constant"> rl </span><span class="Special">$</span><span class="Special">/</span><span class="Statement">;</span>

      say <span class="Special">&quot;</span><span class="Identifier">$</span><span class="Identifier">word</span><span class="Constant"> is a palindrome</span><span class="Special">&quot;</span>
          <span class="Statement">if</span> <span class="Identifier">$</span><span class="Identifier">word</span> <span class="Statement">eq</span> <span class="Identifier">$</span><span class="Identifier">word</span><span class="Statement">.</span>flip<span class="Statement">;</span>
  }</pre></div>
          </div>
          <div role="tabpanel" class="tab-pane" id="samp-fib">
    <div class="highlight"><pre><span class="Special">my</span> <span class="Identifier">@</span><span class="Identifier">primes</span> <span class="Statement">=</span> <span class="Statement">^</span>∞ <span class="Statement">.</span><span class="Identifier">grep</span><span class="Statement">:</span> <span class="Statement">*.</span><span class="Identifier">is</span><span class="Statement">-</span>prime<span class="Statement">;</span>
  <span class="Identifier">say</span> <span class="Special">&quot;</span><span class="Constant">1001ˢᵗ prime is </span><span class="Identifier">@</span><span class="Identifier">primes</span>[<span class="Constant">1000</span>]<span class="Special">&quot;</span><span class="Statement">;</span></pre></div>
          </div>
          <div role="tabpanel" class="tab-pane" id="samp-ops">
    <div class="highlight"><pre><span class="Statement">sub</span> postfix<span class="Statement">:</span><span class="Special">&lt;</span><span class="Constant">!</span><span class="Special">&gt;</span> (<span class="Type">Int</span> <span class="Identifier">$n</span>) {
      <span class="Statement">fail</span> <span class="Special">&quot;</span><span class="Constant">Not a Natural Number in Factorial</span><span class="Special">&quot;</span> <span class="Statement">if</span> <span class="Identifier">$n</span> <span class="Statement">&lt;</span> <span class="Constant">0</span><span class="Statement">;</span>
      <span class="Statement">[*]</span> <span class="Constant">2</span><span class="Statement">..</span><span class="Identifier">$n</span>
  }

  <span class="PreProc">use</span> Test<span class="Statement">;</span>
  isa-ok (<span class="Constant">-1</span>)<span class="Special">!</span><span class="Statement">,</span> <span class="Type">Failure</span><span class="Statement">,</span> <span class="Special">&quot;</span><span class="Constant">Factorial for -1 fails</span><span class="Special">&quot;</span><span class="Statement">;</span>
  ok <span class="Constant">0</span><span class="Special">!</span> <span class="Statement">==</span> <span class="Constant">1</span><span class="Statement">,</span> <span class="Special">&quot;</span><span class="Constant">Factorial for 0</span><span class="Special">&quot;</span><span class="Statement">;</span>
  ok <span class="Constant">1</span><span class="Special">!</span> <span class="Statement">==</span> <span class="Constant">1</span><span class="Statement">,</span> <span class="Special">&quot;</span><span class="Constant">Factorial for 1</span><span class="Special">&quot;</span><span class="Statement">;</span>
  ok <span class="Constant">5</span><span class="Special">!</span> <span class="Statement">==</span> <span class="Constant">120</span><span class="Statement">,</span> <span class="Special">&quot;</span><span class="Constant">Factorial for a larger integer</span><span class="Special">&quot;</span><span class="Statement">;</span></pre></div>
    </div>
          <div role="tabpanel" class="tab-pane" id="samp-more">
            <p class="lead text-center well"
              style="padding-top: 20px;">Want to see more?
                <a href="http://examples.perl6.org/"
              class="btn btn-primary">Visit Perl&nbsp;6 examples page</a>
            </p>
          </div>
        </div>
      </div>
    </div>
    <div class="col-sm-3">
      <div class="panel panel-success">
        <div class="panel-heading">
          <h3 class="panel-title text-center">Recent Blog Posts
            <small>
                <a href="http://pl6anet.org/">[view more]</a>
                <a href="http://pl6anet.org/atom.xml"
                  class="recent_blogs_rss">RSS</a>
            </small>
          </h3>
        </div>
        <div class="panel-body trim">
          <ul id="recent_blog_posts">

          </ul>
        </div>
      </div>
    </div>
  </main>
</div>
